# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BareMetalSolution.V2.Model.NetworkConfig do
  @moduledoc """
  Configuration parameters for a new network.

  ## Attributes

  *   `bandwidth` (*type:* `String.t`, *default:* `nil`) - Interconnect bandwidth. Set only when type is CLIENT.
  *   `cidr` (*type:* `String.t`, *default:* `nil`) - CIDR range of the network.
  *   `gcpService` (*type:* `String.t`, *default:* `nil`) - The GCP service of the network. Available gcp_service are in https://cloud.google.com/bare-metal/docs/bms-planning.
  *   `id` (*type:* `String.t`, *default:* `nil`) - A transient unique identifier to identify a volume within an ProvisioningConfig request.
  *   `jumboFramesEnabled` (*type:* `boolean()`, *default:* `nil`) - The JumboFramesEnabled option for customer to set.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the network config.
  *   `serviceCidr` (*type:* `String.t`, *default:* `nil`) - Service CIDR, if any.
  *   `type` (*type:* `String.t`, *default:* `nil`) - The type of this network, either Client or Private.
  *   `userNote` (*type:* `String.t`, *default:* `nil`) - User note field, it can be used by customers to add additional information for the BMS Ops team .
  *   `vlanAttachments` (*type:* `list(GoogleApi.BareMetalSolution.V2.Model.IntakeVlanAttachment.t)`, *default:* `nil`) - List of VLAN attachments. As of now there are always 2 attachments, but it is going to change in the future (multi vlan). Use only one of vlan_attachments or vrf
  *   `vlanSameProject` (*type:* `boolean()`, *default:* `nil`) - Whether the VLAN attachment pair is located in the same project.
  *   `vrf` (*type:* `String.t`, *default:* `nil`) - Optional. The name of a pre-existing Vrf that the network should be attached to. Format is `vrfs/{vrf}`. If vrf is specified, vlan_attachments must be empty.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bandwidth => String.t() | nil,
          :cidr => String.t() | nil,
          :gcpService => String.t() | nil,
          :id => String.t() | nil,
          :jumboFramesEnabled => boolean() | nil,
          :name => String.t() | nil,
          :serviceCidr => String.t() | nil,
          :type => String.t() | nil,
          :userNote => String.t() | nil,
          :vlanAttachments =>
            list(GoogleApi.BareMetalSolution.V2.Model.IntakeVlanAttachment.t()) | nil,
          :vlanSameProject => boolean() | nil,
          :vrf => String.t() | nil
        }

  field(:bandwidth)
  field(:cidr)
  field(:gcpService)
  field(:id)
  field(:jumboFramesEnabled)
  field(:name)
  field(:serviceCidr)
  field(:type)
  field(:userNote)

  field(:vlanAttachments,
    as: GoogleApi.BareMetalSolution.V2.Model.IntakeVlanAttachment,
    type: :list
  )

  field(:vlanSameProject)
  field(:vrf)
end

defimpl Poison.Decoder, for: GoogleApi.BareMetalSolution.V2.Model.NetworkConfig do
  def decode(value, options) do
    GoogleApi.BareMetalSolution.V2.Model.NetworkConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BareMetalSolution.V2.Model.NetworkConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
